package cn.wenhe9.novel.controller.front;

import cn.wenhe9.novel.constant.ApiRouterConsts;
import cn.wenhe9.novel.domain.dto.HomeBookDto;
import cn.wenhe9.novel.domain.dto.HomeFriendLinkDto;
import cn.wenhe9.novel.result.ResultResponse;
import cn.wenhe9.novel.service.HomeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * 首页模块 API 接口
 *
 * @author DuJinliang
 * 2022/5/18
 */
@Api(tags = "首页模块 API 接口")
@RestController
@RequestMapping(ApiRouterConsts.API_FRONT_HOME_URL_PREFIX)
public class HomeController {

    @Resource
    private HomeService homeService;

    /**
     * 首页小说推荐查询接口
     */
    @ApiOperation("首页小说推荐查询接口")
    @GetMapping("books")
    public ResultResponse<List<HomeBookDto>> listHomeBooks() {
        return homeService.listHomeBooks();
    }

    /**
     * 首页友情链接列表查询接口
     */
    @ApiOperation("首页友情链接列表查询接口")
    @GetMapping("friend_Link/list")
    public ResultResponse<List<HomeFriendLinkDto>> listHomeFriendLinks() {
        return homeService.listHomeFriendLinks();
    }

}
